<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/support/taglibs.jsp" %>
<jsp:useBean id="isernManager" scope="page"
    class="edu.hawaii.myisern.model.IsernManager"/>
           
<stripes:layout-render name="/support/layout/standard.jsp" title="View Researcher" page="researchers">
<stripes:layout-component name="contents">
<stripes:errors/>
<table class="layout"><tr><td class="layoutLeft">
  <stripes:form action="/ResearcherForm.action" id="MyForm">
  
  <table class="leftRightForm">
    <tr>
      <th>ID:</th>
      <td>${empty actionBean.id ? "n/a" : actionBean.id}
        <stripes:hidden name="id"/>
      </td>
    </tr>
    <tr>
      <th>Name:</th>
      <td>${actionBean.researcher.name}</td>                 
    </tr>                             
    <tr>
      <th>Organization:</th>
      <td>
        <stripes:link href="OrganizationForm.action" event="view">
          ${actionBean.researcher.organization}
          <stripes:param name="id" value="${actionBean.researcher.organization}"/>
        </stripes:link>
      </td>                 
    </tr>              
    <tr>
      <th>Email:</th>
      <td><a href="mailto:${actionBean.researcher.email}">${actionBean.researcher.email}</a></td>
    </tr>
    <tr>
      <th>Image Link:</th>
      <td>${actionBean.researcher.pictureLink}</td>
      <td><c:if test="${not empty actionBean.researcher.pictureLink}">
            <img src="${actionBean.researcher.pictureLink}" height=50/>
          </c:if>
      </td>           
    </tr>
    <tr>
      <th>Bio Statement:</th>
      <td>${actionBean.researcher.bioStatement}</td>
    </tr>       
  </table>
  
  <div class="buttons">
    <stripes:submit name="preEdit" value="Edit"/>
    <stripes:submit name="remove" value="Remove" onclick="return confirm('Are you sure you want to remove Researcher ${actionBean.researcher.name}?')"/>
  </div>
  
  </stripes:form>
  
</td>

<td class="layoutRight">

  <table class="engagedCollaborations">
    <tr><th>Engaged Collaborations:</th></tr>
    <c:forEach items="${actionBean.collaborationsByResearcher}" var="collaboration" varStatus="loop"> 
      <tr><td><stripes:link href="CollaborationForm.action" event="view">
        ${collaboration.name}
        <stripes:param name="id" value="${collaboration.name}"/>
        </stripes:link>
      </td></tr>
    </c:forEach>
  </table>

</td></tr></table>

</stripes:layout-component>
</stripes:layout-render>
